package com.yc.star.booksystem.enums;


public enum BookStatusEnum {
    DELETE(0,"无效"),
    NORMAL(1,"可借阅"),
    FORBIDDEN(2,"不可借阅"),
    ;


    private int code;
    private String desc;

    BookStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static BookStatusEnum getNameByCode(Integer code){
        switch (code){
            case 0: return DELETE;
            case 1: return NORMAL;
            case 2: return FORBIDDEN;
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
